package easy;

public class a80_删除有序数组中的重复项II {
    public int removeDuplicates(int[] nums) {
        int len=nums.length;
        if(len<=2){
            return len;
        }
        int slow=2,fast=2;
        while (fast<len){
            if(nums[slow-2]!=nums[fast]){
                nums[slow]=nums[fast];
                slow++;
            }
            fast++;
        }
        return nums.length;
    }
}
